package com.yuki.consumer.aop;

import com.alibaba.fastjson.JSON;
import com.yuki.api.model.UmsLog;
import com.yuki.api.service.IUmsLogService;

/**
 * @description:
 * @author: Yuki Tadayoshi
 * @time: 2021/3/30 17:58
 */
public class SaveLogThread implements Runnable {

    private UmsLog log;
    private IUmsLogService service;

    public SaveLogThread(UmsLog log, IUmsLogService service) {
        this.log = log;
        this.service = service;
    }

    @Override
    public void run() {
        System.out.println(JSON.toJSON(log));
        service.insert(log);
    }
}
